/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package EL;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;

/**
 *
 * @author Tian
 */
@Entity
@Table(name = "RoomType")
@NamedQueries(
{
    @NamedQuery(name = "RoomTypes.findAll", query = "SELECT r FROM RoomTypes r")
})
public class RoomTypes implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue (strategy=GenerationType.AUTO)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Column(name = "type")
    private String type;
    @Lob
    @Column(name = "description")
    private String description;
    @Column(name = "surcharge")
    private Float surcharge;
    @OneToMany(cascade = {CascadeType.MERGE, CascadeType.REMOVE, CascadeType.REFRESH}, mappedBy = "roomTypes")
    @LazyCollection(LazyCollectionOption.FALSE)
    private List<DiningRooms> diningRoomsList;

    public RoomTypes()
    {
    }

    public RoomTypes(String type, String description, Float surcharge)
    {
        this.type = type;
        this.description = description;
        this.surcharge = surcharge;
    }

    

    public Integer getId()
    {
        return id;
    }

    public void setId(Integer id)
    {
        this.id = id;
    }

    public String getType()
    {
        return type;
    }

    public void setType(String type)
    {
        this.type = type;
    }

    public String getDescription()
    {
        return description;
    }

    public void setDescription(String description)
    {
        this.description = description;
    }

    public Float getSurcharge()
    {
        return surcharge;
    }

    public void setSurcharge(Float surcharge)
    {
        this.surcharge = surcharge;
    }

    public List<DiningRooms> getDiningRoomsList()
    {
        return diningRoomsList;
    }

    public void setDiningRoomsList(List<DiningRooms> diningRoomsList)
    {
        this.diningRoomsList = diningRoomsList;
    }

    @Override
    public int hashCode()
    {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object)
    {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RoomTypes))
        {
            return false;
        }
        RoomTypes other = (RoomTypes) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)))
        {
            return false;
        }
        return true;
    }

    @Override
    public String toString()
    {
        return "EL.RoomTypes[id=" + id + "]";
    }

}
